package views;

import controllers.ChatController;  
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import models.*;
import controllers.*;
import java.net.DatagramPacket;
import java.net.Inet4Address;

// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.11A1D690-91FE-ED47-A68B-9F7936ACDD97]
// </editor-fold> 
public class ChatNi {

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.EE7EC992-25C8-8BD6-12B3-9A45197DD79D]
    // </editor-fold> 
    private ChatController cont;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.FA8161C9-1EDA-100E-7232-F91E47A92F13]
    // </editor-fold> 
    public void sendHello (Contact dst, Boolean resplyRequired) {
        try {
            // building the message
            Hello hello = new Hello(cont.getLUser(), resplyRequired);
            // converting the message into a bytearray to send
            byte[] byteHello = Message.toByteArray(hello);
            // building the UDP datagram
            //DatagramPacket datagramPacket = new DatagramPacket(byteHello, byteHello.length, new Inet4Address("127.0.0.1"), 5555);

        } catch (Exception ex) {
            Logger.getLogger(ChatNi.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.5FBB203E-79FE-EE19-422F-57C8B47BCF23]
    // </editor-fold> 
    public void sendMsg (String m, ArrayList<Contact> destCont, ArrayList<Contact> srcContact) {
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.6266F561-CFF1-8E9A-DD4A-91C80E514E33]
    // </editor-fold> 
    public void sendBye (Contact c) {
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.F0043451-27AD-0250-2CB5-B573F659CF43]
    // </editor-fold> 
    public void sendFile (String f, ArrayList<Contact> destCont, ArrayList<Contact> srcContact) {
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.012E8545-7990-1AFB-AD4F-3189E7B25107]
    // </editor-fold> 
    public void initialize () {
    }

    /**
     *  @param cont the cont to set
     */
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.85863A46-4D75-C508-427B-91886B137327]
    // </editor-fold> 
    public void setController (ChatController cont) {
        this.cont = cont;
    }

}

